#pragma once
#include "UserTypes.h"
using namespace System::Collections::Generic;

namespace Reign
{namespace Core
{
	template <class TKey, class TValue>
	Dictionary<TKey,TValue>^ DictionaryInitializer(array<KeyValuePair<TKey,TValue>>^ keyValuePairs)
	{
		Dictionary<TKey,TValue>^ dictionary = gcnew Dictionary<TKey,TValue>();
		for each (KeyValuePair<TKey,TValue> pair in keyValuePairs)
		{
			dictionary->Add(pair.Key, pair.Value);
		}
		return dictionary;
	}

	template <class TKey, class TValue>
	Dictionary<TKey,TValue>^ DictionaryInitializer(TKey key, TValue value)
	{
		return DictionaryInitializer<TKey,TValue>(
			gcnew array<KeyValuePair<TKey,TValue>>
			{
				KeyValuePair<TKey,TValue>(key, value)
			});
	}
}
}